const dic = {
  auditContent: [
    {
      label: '现场审核结果',
      value: '0'
    },
    {
      label: '潜在风险',
      value: '1'
    },
    {
      label: '附件',
      value: '2'
    }
  ],
  superiorQuota: [
    {
      label: '现场审核结果',
      value: '0'
    },
    {
      label: '潜在风险',
      value: '1'
    },
    {
      label: '附件',
      value: '2'
    }
  ],
  responseDepart: [
    {
      label: 'xx1',
      value: '0'
    },
    {
      label: 'xx2',
      value: '1'
    }
  ],
  responsePerson: [
    {
      label: 'xx1',
      value: '0'
    },
    {
      label: 'xx2',
      value: '1'
    }
  ],
  quotaType: [
    {
      label: '节点',
      value: '0'
    },
    {
      label: '目录',
      value: '1'
    }
  ]
}
export const option = function () {
  return {
    labelWidth: 120,
    emptyBtn: false,
    submitBtn: false,
    detail: ['view'].includes(this.type),
    column: [
      {
        label: '物料分类',
        prop: 'materialClassify',
        formslot: true,
        span: 8
      },
      {
        label: '应用说明',
        prop: 'explain',
        type: 'textarea',
        maxlength: 500,
        minRows: 4,
        maxRows: 6,
        span: 24
      }
    ]
  }
}
export const templateOption = function () {
  return {
    refreshBtn: false,
    columnBtn: false,
    border: true,
    stripe: true,
    index: true,
    editBtn: false,
    delBtn: false,
    align: 'center',
    addBtn: false,
    menu: !['view'].includes(this.type),
    labelWidth: 120,
    indexLabel: '序号',
    column: [
      {
        label: '审核项名称',
        maxlength: 50,
        prop: 'name'
      },
      {
        label: '审核项内容',
        maxlength: 50,
        prop: 'content'
      },
      {
        label: '负责部门',
        maxlength: 50,
        prop: 'deptCode'
      },
      {
        label: '负责人',
        maxlength: 50,
        prop: 'principalCode'
      }
    ]
  }
}

export const quotaOption = function () {
  return {
    refreshBtn: true,
    columnBtn: true,
    border: true,
    stripe: true,
    index: true,
    editBtn: false,
    delBtn: false,
    align: 'center',
    addBtn: false,
    menu: !['view'].includes(this.type),
    selection: true,
    reserveSelection: false,
    tip: false,
    labelWidth: 120,
    defaultExpandAll: true,
    indexLabel: '序号',
    column: [
      {
        label: '指标名称/说明',
        maxlength: 50,
        prop: 'name'
      },
      {
        label: '指标审核标准说明',
        maxlength: 50,
        prop: 'standard'
      },
      {
        label: '分值',
        maxlength: 50,
        prop: 'scoreVal'
      },
      {
        label: '负责人',
        maxlength: 50,
        prop: 'principalCode'
      }
    ]
  }
}

export const taskOption = function () {
  return {
    refreshBtn: false,
    columnBtn: false,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    labelWidth: 120,
    indexLabel: '序号',
    column: [
      {
        label: '审核项名称',
        prop: 'name',
        formslot: true,
        span: 10
      },
      {
        label: '审核项内容',
        prop: 'contents',
        type: 'checkbox',
        props: {
          label: 'label',
          value: 'value'
        },
        dicData: dic.auditContent,
        span: 14
      },
      {
        label: '现场审核填写说明',
        prop: 'explanation',
        type: 'textarea',
        hide:true,
        maxlength: 500,
        minRows: 4,
        maxRows: 6,
        span: 24
      },
      {
        label: '潜在风险填写说明',
        prop: 'riskExplain',
        type: 'textarea',
        hide:true,
        maxlength: 500,
        minRows: 4,
        maxRows: 6,
        span: 24
      },
      {
        label: '附件上传写说明',
        prop: 'attachExplain',
        type: 'textarea',
        hide:true,
        maxlength: 500,
        minRows: 4,
        maxRows: 6,
        span: 24
      },
      {
        label: '负责部门',
        prop: 'deptCode',
        type: 'tree',
        dicData: [],
        props: {
          label: 'title'
        },
        checkStrictly: true,
        span: 12
      },
      {
        label: '负责人',
        prop: 'principal',
        formslot:true,
        span: 12
      }
    ]
  }
}

export const quotaOpt = function () {
  return {
    refreshBtn: false,
    columnBtn: false,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    labelWidth: 120,
    column: [
      {
        label: '指标项名称',
        prop: 'name',
        type: 'textarea',
        minRows: 4,
        maxRows: 6,
        maxlength: 3000,
        span: 24
      },
      {
        label: '上级指标',
        prop: 'parentId',
        type: 'select',
        props: {
          label: 'label',
          value: 'value'
        },
        dicData: dic.superiorQuota,
        span: 12
      },
      {
        label: '指标评分名称',
        prop: 'scoreName',
        type: 'textarea',
        maxlength: 500,
        minRows: 4,
        maxRows: 6,
        span: 24
      },
      {
        label: '指标项类型',
        prop: 'type',
        type: 'radio',
        props: {
          label: 'label',
          value: 'value'
        },
        dicData: dic.quotaType,
        span: 12
      },
      {
        label: '分值',
        prop: 'scoreVal',
        type: 'number',
        value: 1,
        span: 12
      },
      {
        label: '负责部门',
        prop: 'deptCode',
        type: 'tree',
        dicData: [],
        props: {
          label: 'title'
        },
        checkStrictly: true,
        span: 12
      },
      {
        label: '负责人',
        prop: 'principal',
        formslot:true,
        span: 12
      }
    ]
  }
}
